/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package clasificador.redneuronal.neurona;

import utils.Observable;
import java.util.Observer;

/**
 *
 * @author e237573
 */
public abstract class Signal<T> extends Observable {
    protected T value;
    boolean isUpdated;
    
    public T getValue() {
        if(!isUpdated) {
            recalculate();
            isUpdated = true;
        }
        return value;
    }
    
    public void invalidate() {
        this.isUpdated = false;
    }
    
    public abstract void recalculate();
}
